﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SignInServices.Common;
using System.Web.Configuration;

namespace SignInServices.Code
{
    internal static class SSOFederationHelper
    {
        private static ISSOFederation innerInstance = null;
        public static ISSOFederation FederationObject
        {
            get
            {
                if (innerInstance == null)
                    innerInstance = loadFederationType();
                return innerInstance;
            }
        }

        private static ISSOFederation loadFederationType()
        {
            string typeName = WebConfigurationManager.AppSettings["federationType"];
            Type loadedType =  Type.GetType(typeName);
            return  Activator.CreateInstance(loadedType) as ISSOFederation;
        }
    }
}